// 根据角色动态生成路由
import { defineFakeRoute } from 'vite-plugin-fake-server/client'

export default defineFakeRoute([
  {
    url: '/api/v1/login',
    method: 'post',
    response: ({ body }) => {
      console.log(body.username)
      return {
        code: 200,
        message: '登录成功!',
        data: {
          username: 'admin',
          accessToken: 'eyJhbGciOiJIUzUxMiJ9.admin',
          refreshToken: 'eyJhbGciOiJIUzUxMiJ9.adminRefresh',
          expires: '2030/10/30 00:00:00'
        }
      }
    }
  }
])
